/*
 * @Author: gk 
 * tree+ grid+button+editform Page的页面
 * @Date: 2018-01-17 09:53:01 
 * @Last Modified by: mikey.zhaopeng
 * @Last Modified time: 2018-03-15 14:25:51
 */
layui.define(['zlConfig','zlContext'], function (exports) {
    "use strict";
    var $ = layui.$
        , config = layui.zlConfig
        , zlContext = layui.zlContext
        , init = function (options) {
            options = options || {};
            var that = this;
            var btnHtml = [];
            zlContext.get(options.url, {}, function (result) {
                //合并返回功能配置信息
                $.extend(options, result);
                /**渲染Tree*/
            })
        }
        , zlTree = function () {};
    zlTree.prototype.render = function (options, params) {
        var that = this;
        that.config = {
            url: '' //页面的url
            , title: ''
            , pageSize: 20
            , id: '' //dom元素的id
            , elem: ''
        }
        //合并复制options配置到config
        $.extend(true, that.config, options);
        //获取page的dom对象    
        that.config.elem = $("#" + that.config.id);
        that.config.url = $(that.config.elem).attr("url");
        if (zlContext.isEmpty(that.config.url)) {
            zlContext.warnMsg("zlTree url不能为空!");
            return;
        }
        init(that.config);
    };
    /**加载数据 */
    zlTree.prototype.load = function () {
        var that = this;
        context: get(that.config.url, "", function () { }, false);
    }
    var tree = new zlTree();
    exports("zlTree", tree);
});